package com.example.multidatasource.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.example.multidatasource.entity.Teacher;
import com.example.multidatasource.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author 周明军
 * @since 2020/4/17
 */
@RestController
@RequestMapping("teacher")
public class TeacherController {
    @Autowired
    private TeacherService teacherService;

    @GetMapping("/list")
    public R<List<Teacher>> list() {
        List<Teacher> list = teacherService.list();
        return R.ok(list);
    }
}
